#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    , myButton(new QPushButton(this))
{
    ui->setupUi(this);

    myButton->setText("hello world");
    myButton->move(300, 200);
    connect(myButton, &QPushButton::clicked, this, &Widget::close);
//    this->move(0, 0);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{
    if (myButton->text() == QString("hello world"))
        myButton->setText("hello qt");
    else
        myButton->setText("hello world");
}

